package com.bite.system.controller.user;

import com.bite.common.core.controller.BaseController;
import com.bite.common.core.domain.R;
import com.bite.common.core.domain.TableDataInfo;
import com.bite.system.domain.user.User;
import com.bite.system.domain.user.dto.UserDTO;
import com.bite.system.domain.user.dto.UserQueryDTO;
import com.bite.system.service.user.IUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/user")
@RestController

public class UserController extends BaseController {

    @Autowired
    private IUserService iUserService;


    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO){
        return getTableDataInfo(iUserService.list(userQueryDTO));
    }

    @PutMapping("/updateStatus")
    //todo 拉黑的时候,限制用户的操作  解禁,放开用户的操作
    public R<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toR(iUserService.updateStatus(userDTO));
    }


}
